package com.aspose.cells;

public class Border {
   private BorderCollection b;
   zakp a;
   private int c;
   private int d = 0;

   Border(BorderCollection borders) {
      this.b = borders;
      this.a = new zakp(false);
      this.a.a(true);
   }

   Border(BorderCollection borders, int type) {
      this.b = borders;
      this.a = new zakp(false);
      this.a.a(true);
      this.c = type;
   }

   public ThemeColor getThemeColor() {
      if (this.a.b() == 4) {
         int var1 = zsk.c(this.a.d());
         return new ThemeColor(var1, this.a.f());
      } else {
         return null;
      }
   }

   public void setThemeColor(ThemeColor value) {
      this.a.a(4, zsk.d(value.getColorType()));
      this.a.a(value.getTint());
      this.b();
   }

   public Color getColor() {
      return this.a.a() ? Color.getBlack() : this.a.b(this.b.a().e().n());
   }

   public void setColor(Color value) {
      if (!com.aspose.cells.a.c.zh.a(value) && value != Color.getBlack()) {
         this.a.a(2, value.toArgb());
      } else {
         this.a.a(true);
      }

      this.a.e();
      this.b();
   }

   public int getArgbColor() {
      return this.getColor().toArgb();
   }

   public void setArgbColor(int value) {
      this.setColor(Color.fromArgb(value));
   }

   private void b() {
      if (!this.b.a().m()) {
         this.b.a().f(true);
      }

      switch(this.c) {
      case 1:
         this.b.a().a(this.b.a().p() | 16777216L);
         break;
      case 2:
         this.b.a().a(this.b.a().p() | 33554432L);
         break;
      case 4:
         this.b.a().a(this.b.a().p() | 67108864L);
         break;
      case 8:
         this.b.a().a(this.b.a().p() | 134217728L);
         break;
      case 16:
         this.b.a().a(this.b.a().p() | 1073741824L);
         break;
      case 32:
         this.b.a().a(this.b.a().p() | 536870912L);
         break;
      case 64:
         this.b.a().a(this.b.a().p() | 2147483648L);
         break;
      case 128:
         this.b.a().a(this.b.a().p() | 268435456L);
      }

   }

   int a() {
      return this.c;
   }

   void a(int var1) {
      this.c = var1;
   }

   public int getLineStyle() {
      return this.d;
   }

   public void setLineStyle(int value) {
      this.d = value;
      if (this.b.a() != null) {
         this.b.a().f(true);
      }

      switch(this.c) {
      case 1:
         this.b.a().a(this.b.a().p() | 16777216L);
         break;
      case 2:
         this.b.a().a(this.b.a().p() | 33554432L);
         break;
      case 4:
         this.b.a().a(this.b.a().p() | 67108864L);
         break;
      case 8:
         this.b.a().a(this.b.a().p() | 134217728L);
         break;
      case 16:
         this.b.a().a(this.b.a().p() | 1073741824L);
         break;
      case 32:
         this.b.a().a(this.b.a().p() | 536870912L);
         break;
      case 64:
         this.b.a().a(this.b.a().p() | 2147483648L);
         break;
      case 128:
         this.b.a().a(this.b.a().p() | 268435456L);
      }

   }

   void b(int var1) {
      this.d = var1;
   }

   void a(Border var1) {
      if (var1.a.b() == 3 && var1.b.a().e() != this.b.a().e()) {
         this.a.a(2, var1.a.c(var1.b.a().e().n()));
      } else {
         this.a.f(var1.a);
      }

      this.d = var1.d;
   }

   boolean a(Border var1, Workbook var2, Workbook var3) {
      if (this.d != var1.d) {
         return false;
      } else {
         return this.d == 0 || !this.a.b(var1.a, var2, var3);
      }
   }

   boolean b(Border var1) {
      if (this.d != var1.d) {
         return false;
      } else {
         return this.d == 0 || !this.a.c(var1.a);
      }
   }
}
